package com.zz.bid.service;

import com.zz.bid.entity.Menu;
import com.zz.bid.exception.base.BidException;
import com.zz.bid.mapper.MenuMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class MenuService {
    @Autowired
    private MenuMapper menuMapper;

    public List<Menu> getMenus() throws BidException {
        try {
            return menuMapper.getMenus();
        } catch (Exception e) {
            log.error(e.getMessage());
            throw new BidException(e.getMessage());
        }
    }
}
